/*
*  gconvo.h - Conversation window
*  Copyright (c) 2005 Derek Ingrouville (dergro@users.sourceforge.net)
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU Library General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifndef _GCONVO_H
#define _GCONVO_H

#include <gtk/gtk.h>

#include "msn/switchboard.h"

typedef struct _GConvo GConvo;

typedef void (*GConvoClosedCB)(GConvo *convo, gpointer data);

struct _GConvo
{
	MsnSession *session;
	MsnSwitchboard *sboard;
	MsnContact *primary_contact; /* Primary participant */
	GList *participants; /* primary + addditional participants */
	guint num_participants; /* number of participants in the session */
	GQueue *msg_queue;
	gboolean connected;
	gboolean connecting;
	GConvoClosedCB closed_cb;
	gpointer cb_data;

	/* UI */
	GtkWindow *window;	/* The window.. */
	GtkLabel *contact_label; /* Info about primary participant */
	GtkTextView *convo_view;   /* Displays contents of chat */
	GtkTextBuffer *convo_buffer; /* Holds contents of chat */
	GtkTextView *entry_view;	/* Displays what you type */
	GtkTextBuffer *entry_buffer; /* Holds what you type */
	GtkLabel *status_label; /* Statusbar at the bottom */
	guint typing_timeout_id;
};

GConvo *gconvo_new (MsnSession *session, MsnSwitchboardType type);
void gconvo_set_switchboard (GConvo *convo, MsnSwitchboard *sboard);
int gconvo_invite_participant (GConvo *convo, const char *passport);
void gconvo_refresh_info (GConvo *convo);
void gconvo_show (GConvo *convo);
void gconvo_close (GConvo *convo);
void gconvo_set_window_closed_cb (GConvo *convo, GConvoClosedCB func, gpointer data);
void gconvo_warn_status_hidden (GConvo *convo);

#endif /* GCONVO_H */
